package com.guogee.util;

public class ByteStringUtils {

	public static String bytetoString(byte[] digest) {

		int i = 0;
		StringBuffer buf = new StringBuffer("");
		for (int offset = 0; offset < digest.length; offset++) {
			i = digest[offset];
			if (i < 0)
				i += 256;
			if (i < 16)
				buf.append("0");
			buf.append(Integer.toHexString(i));
		}

		return buf.toString();

	}

}
